/*
 * AbstractEvent.java - Copyright May 9, 2012 Z Networks Group, Inc. All rights reserved.
 * Z Networks Group PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 */
package com.andromeda.lang.event;

/**
 *
 * @author Dickinson Roman Arismendy Torres
 */
public class AbstractEvent<T extends EventSource> implements Event {

    private final T source;
    private final long when;

    public AbstractEvent(T source) {
        this(source, System.currentTimeMillis());
    }

    public AbstractEvent(T source, long when) {
        this.source = source;
        this.when = when;
    }

    @Override
    public EventSource getSource() {
        return source;
    }

    @Override
    public long when() {
        return when;
    }
}
